using System;
using System.Configuration;

namespace App.Modelo.Config
{
    /// <summary>
    /// This class is actually what loads the custom settings.
    /// </summary>
    public class SeguridadConfiguration : System.Configuration.ConfigurationSection
    {
        private static string sConfigurationSectionConst = "Seguridad";

        /// <summary>
        /// Returns an shiConfiguration instance
        /// </summary>
        public static SeguridadConfiguration GetConfig()
        {

            return (SeguridadConfiguration)System.Configuration.ConfigurationManager.
                                               GetSection(SeguridadConfiguration.sConfigurationSectionConst) ??
                   new SeguridadConfiguration();

        }
      
        [ConfigurationProperty("Modulos")]
        public ModulosSettingCollection Modulos 
        {
            get
            {
                return (ModulosSettingCollection)this["Modulos"] ?? 
                       new ModulosSettingCollection();
            }
        }

        [ConfigurationProperty("menuFile",IsRequired = true)]
        public String MenuFile
        {
            get
            {
                return (String)this["menuFile"] ?? "";
            }
        }
    }
}